<?php
defined( 'ABSPATH' ) || exit;

get_header();
?>

<div class="container hers_news">
	<?php
	if(have_posts()){
		$count = 0;
		while(have_posts()){
			the_post();
			$count++;
			if(1==$count%2)
			{
	?>
	<ul class="recent-posts animate-box">
		<li class="col-sm-4">
			<div class="border-img">
				<img loading="lazy" src="<?php 
				if(has_post_thumbnail()){
					the_post_thumbnail_url('medium');
					echo '" alt="'.get_post_meta(get_post_meta( $post->ID, '_thumbnail_id',true ),'_wp_attachment_image_alt',true);
					}else{
						echo '/images/no-pic-news.jpg" alt="赫思模特';
					}
				?>">
			</div>
		</li>
		<li class="col-sm-8">
			<div class="recent-post-desc">
				<h2><?php the_title();?></h2>
				<p class="post-cat"><?php the_time('Y-m-d');?></p>
				<div class="clearfix"></div>
				<p><?php the_excerpt();?></p>	
				<p><?php if(has_tag()){the_tags();} ?></p>
				<a href="<?php echo get_permalink()?>" class="btn">点击阅读</a>
			</div>
		</li>
	</ul>
			<?php
			}else{
			?>
	<ul class="recent-posts right-img animate-box">
		<li class="col-sm-8">
			<div class="recent-post-desc">
				<h2><?php the_title();?></h2>
				<p class="post-cat"><?php echo the_time('Y-m-d');?></p>
				<div class="clearfix"></div>
				<p><?php the_excerpt();?></p>			
				<a href="<?php echo get_permalink()?>" class="btn">点击阅读</a>
			</div>
		</li>
		<li class="col-sm-4">
			<div class="border-img">
				<img loading="lazy" src="<?php 
				if(has_post_thumbnail()){
					the_post_thumbnail_url('medium');
					echo '" alt="'.get_post_meta(get_post_meta( $post->ID, '_thumbnail_id',true ),'_wp_attachment_image_alt',true);
					}else{
						echo '/images/no-pic-news.jpg" alt="赫思模特';
					}
				?>">
			</div>
		</li>
	</ul>
	<?php
			}
		}
	}
	get_template_part( 'content', 'paging' );
	?>
	
</div>

<?php
get_footer();
?>